import time
from cmath import polar

from selenium.webdriver.common.by import By

from Unit_01.Page.page1 import Page1
import unittest
from selenium import webdriver

from Unit_01.Page.page2 import Page2


class Testcase(unittest.TestCase):
    def setUp(self):
        self.drive=webdriver.Edge()
        self.drive.maximize_window()

    def tearDown(self):
        time.sleep(10)
        self.drive.quit()


    def test_jiuxian_01(self):
        po=Page1(self.drive)
        po.open_url("https://www.jiuxian.com/")
        po.login()
        dy1=self.drive.find_element(By.XPATH,'//*[@id="loginform"]/div/div/div/div/div[1]/div[1]/a[1]').text
        print(dy1)
        self.assertEqual('帐号登录',dy1)
        po.uname()
        po.password()
        time.sleep(15)
        po.loginbtn()
        po.accept()
        # dy2=self.drive.find_element(By.XPATH,'/html/body/div[2]/div/div[1]/div/p/span').text
        # print(dy2)+
        # self.assertEqual('jxw225264768',dy2)

    def test_jiuxian_02(self):
        po=Page2(self.drive)
        po.jiuxian_luoji2()
if __name__ == '__main__':
    unittest.main()
